import { close, connect, ObjectId } from "../../util/mongo"

export default defineEventHandler(async (event) => {
  const id = getRouterParam(event,"id")
    const {client,db } = await connect()
    const material =  db.collection('commonpart');
  
    const _id = new ObjectId(id)
    const docs = await material.deleteOne({_id})
  
    close(client)
  return docs
})
